package com.stu.easyretry;

/**
 * @projectName: learn_used_code
 * @packageName: com.stu.easyretry
 * @className: com.stu.easyretry-> TestRetry
 * @createDate: 2022-03-17 17:09
 * @author: ZhangSheng
 * @version: 1.0
 * @description:
 */
public class TestRetry {


    public static void main(String[] args) {
        EasyRetry easyRetry = EasyRetryBuilder.newBuilder()
                .includeExceptions(Exception.class)
                .maxAttempts(10)
                .maxWaitTime(100000L)
                .backoff(5000L)
                .build();
        easyRetry.call(() -> {
            int num = 1/0;
            System.out.println("doSomething...");
            return null;
        });
    }
}
